<script type="text/javascript">
  function key(){
  if(form1.keywords.value==""){
    alert("请输入查询关键字！");form1.keywords.focus();
       return false;
  }
  if((form1.keywords.value.length)>50){
    alert("关键字过长，请简化在50个字符内！");
          form1.keywords.focus();return false;
  }
} 
</script>

<script type="text/javascript">
  
  // hover购物车
$(function(){
  $('.r ul li.cart').hover(function(){
     $('.down').show();
      $.ajax({
                url: "{|U:"Common/hoverCart"}",
                type: 'POST',
                dataType: 'json',
                success:function(phpData){
          var str='';
          $.each(phpData.goods,function(k,v) {
     str+=' <li class="t"><a class="pic" href="{|U:'Index/Details/index'}/type_id/'+v.good.type_id+'/cat_id/'+v.good.cat_id+'/goods_id/'+v.good.goods_id+'"><img src="__ROOT__/'+v.good.goods_img+'" alt="" width="60" height="60"></a> <a href="{|U:'Index/Details/index'}/type_id/'+v.good.type_id+'/cat_id/'+v.good.cat_id+'/goods_id/'+v.good.goods_id+'" class="name">'+v.good.goods_name+'</a><p class="price">¥<em>'+v.price+'*'+v.num+'</em><a href="javascript:;" class="del" sid="'+k+'">删除</a></p></li>';
      });


           $('.down .cart_list').html(str);
          $('.total_price .total').html(phpData.total);
          $('.jian em').html(phpData.total_rows);

        }
})

  },function(){

 $('.down').hide();
});

// 删除
$("p.price a.del").live('click', function() {

              var sid=$(this).attr('sid');
               var _this = $(this);
                // alert(sid);
              $.ajax({
                url: "{|U:"Cart/delOne"}",
                type: 'POST',
                dataType: 'json',
                data: {sid:sid},
                success:function(phpData){

                 _this.parents('li.t').remove();
                 $('.total_price .total').html(phpData);
                }
              })
            });

})
</script>
<div id="top">
<div class="topin">
  <!-- 顶部左边开始 -->
    <div class="topleft">
      <ul>
         <li class="login">

    <if value='!isset($hd.session.username)'>
  <span>&nbsp;Hi,请<a href="{|U:'User/login'}">登录</a>/<a href="{|U:'User/register'}">注册</a></span>
    <else />
   <span style="">&nbsp;<span>{$hd.session.username},</span><a href="{|U:'User/out'}">退出</a></span>
    </if>
        <i></i>
        <div class="list ucenter" > 
          <a  class="l-img" href="#"></a> 

      <a  class="j" href="">会员专享，签到赚积分</a>
             <a class="h" href="">欢迎进入我的1号店 ></a>
             <p>
              <a href="">积分</a><a href="">勋章</a>
             </p>
            </div>
                 </li>
       <!--           <li class="ship"><span>送货至</span><a class="c"href="#">北京</a>
                 省份选择下拉菜单 
                <div class="list province" >
               
                  <p><span> 热门省市</span>
                       <a href="#">上海</a>
                       <a href="#">北京</a>
                       <a href="#"> 广东</a>
                       <a href="#">四川</a>


                        <a href="#">福建</a>
                </p>
                 <ul>
                  <li>A <a href="#">安徽</a></li>
                  <li>B <a href="#">北京</a></li>
                  <li>C <a href="#">重庆</a></li>
                  <li>G <a href="#">广东</a><a href="#">广西</a>
                   <a href="#">贵州</a><a href="#">甘肃</a>
                  </li>
                  <li>F <a href="#">福建</a></li>
                  <li>H <a href="#">河北</a><a href="#">黑龙江</a><a href="#">海南</a><a href="#">湖北</a><a href="#">湖南</a><a href="#">河南</a></li>
                  <li>J <a href="#">江苏</a><a href="#">吉林</a><a href="#">江西</a></li>
                  <li>L <a href="#">辽宁</a></li>

                 </ul>
               <ul>
                <li>N <a href="#">内蒙古</a><a href="#">宁夏</a></li>
                <li>Q <a href="#">青海</a></li>
                <li>S <a href="#">上海</a><a href="#">山东</a><a href="#">山西</a><a href="#">四川</a><a href="#">陕西</a></li>
                <li>T <a href="#">天津</a></li>
                <li>X <a href="#">西藏</a></li>
                <li>Y <a href="#">云南</a></li>
                <li> Z <a href="#"> 浙江</a></li>
               </ul>
             </div>
              省份选择下拉结束 
                 </li> -->
      </ul>
            </div>
    <!-- 顶部左边结束 -->
    <!-- 顶部右边便开始 -
    <div class="topright">
     <ul >
      <li ><a href="#"> 我的1号店 <i></i></a>
            <div class="list">
              <i></i>
              <ul >
                <li ><a href="#">我的订单</a></li>
                  <li><a href="#">我的积分</a></li>
                  <li><a href="#">我的抵用劵</a></li>
                  <li><a href="#">我的收藏夹</a></li>
                  <li><a href="#">我的评论</a></li>
                  <li><a href="#">会员专享</a></li>
              </ul>
            </div>

      </li>
      <li class="fav"><a href="#"> 收藏夹<i></i></a>
             <div class="list"  >
                  <i></i>
                <ul >
                  <li><a href="#">商品收藏</a></li>
                  <li><a href="#">店铺收藏</a></li>
                 </ul>
           </div>
          </li>
      <li class="tel"><a href="#"><em class="ico"></em> 手机1号店<i></i></a>
          <div class="list tel ">
          <i></i>
         <p>客户端注册送100元壕礼</p>
         
        <div class="mobile">
         <a href="#">iPhone</a>
         <a href="#">iPad</a>
         <a href="#">Android</a>
         
         </div>
         <img src="__PUBLIC__/images/code.jpg" alt="" />

       </div>

      </li>
      <li class="vdian"><a href="#"><em class="ico ico2"></em> 1号V店<i></i></a>
         <div class="list "  >
          <i></i>
               <span>0门槛开店赚钱</span>
              <span><a href="">什么是1号V店？</a></span>
               <img src="__PUBLIC__/images/v.jpg" alt="" />
        </div>
    

      </li>
      <li class="ser"><a href="#"> 客户服务<i></i></a>

      <div class="list">
      <i></i>
          <ul>
            <li><a href="#">包裹跟踪</a></li>
            <li><a href="#">常见问题</a></li>
            <li><a href="#">在线退换货</a></li>
            <li><a href="#">在线投诉</a></li>
            <li><a href="#">配送范围</a></li>
            
            </ul>
        </div>



      </li>
      <li  class="dao"><a href="#"> 网站导航<i></i></a>
           <div class="list">
          <i></i>
          <p> <a href="#">1号商城</a>   <a href="#">壹药网</a></p>
          <p class="info"> <a href="">1起创</a><a href="">1号社区</a><a href="">1号校园</a><a href="">0元试用</a><a href="">平安金卡</a><a href="">分销平台</a></p>
          <p class="end"><a href="">网站联盟</a><a href="">招商通道</a><a href="">  企业采购</a></p>

          </div>


      </li>

     <span>关注我们: <a class="weibo" href=""></a><a class="code" href=""></a></span>
       </ul>
    </div>
    <!-- 顶部右边结束 -->
  </div>


</div>

<!-- 顶部结束 -->

<!-- 广告开始 -->
<!-- <div id="ad">
  <a href=""><img src="__PUBLIC__/images/ad.jpg" alt="" /></a>
</div> -->
<!-- 广告结束 -->
<!-- 搜索区域开始 -->
<div class="search_area">
<a href="__ROOT__"><img src="__PUBLIC__/images/logo.png" alt="" /></a>


<div class="search">
  
     <form name="form1" action="{|U:'List/index'}" method="get" onsubmit="return key()">
    
    <input type="text" name="keywords"  class="int" value="纸巾陆战队4折起 清风卷筒纸10卷App专享价14.9元" onfocus="this.value=''"  value="{$word}"  />
    <input type="submit"  class="f_btn" value="搜索" />
    </form>
    <p class="hotwords">
    <a  href="#">小米手机</a>
    <a href="#">蒙奇奇</a>
    <a href="#">耳麦</a>
    <a href="">苹果手机壳</a>
    <a href="">酷派 </a>
        <a href="">老人手机</a>
        <a href="">天语手机</a>
        <a href=""> 小米耳机</a>
        <a href=""> 减肥</a>
         <a href=""> 大连</a>
    </p>
    </div>     
  <div class="r">
  <ul>
    <!-- <li class="icon fu" ><a href="#"><i></i>福利<s></s></a></li>
  <li class="icon order"><a  href="#"><i></i>订单查询<s></s></a></li> -->
    <li class="cart" id="hoverCart" ><i class="arrow"></i><a href="{|U:'Cart/index'}" class="cart"><i></i>购物车</a>
    <if value="!isset($_SESSION['cart'])||$_SESSION['cart']['total']==0">
    <div class="down" >
      <span class="cart_ico"></span>
      <p class="text">您的购物车里还没有1号店的商品哦~~</p>
</div>
<else/>
<div class="down" >
  <div class="total_price">
    <a href="{|U:'Cart/index'}">查看购物车</a>
    <p>商品总价</p>
    <strong>¥<em class="total"></em></strong>
  </div>
  <ul class="cart_list">
   <!--  <li class="t">
      <a class="pic" href="#"><img src="__PUBLIC__/images/buyed.jpg" alt="" width="60" height="60"></a>
      <a href="#" class="name">昊昊 2015新款夏季短袖休闲上衣 亚麻宽松衬衣文艺棉麻衬衫 7108#灰色</a>
      <p class="price"><em>¥144.00</em><a href="#" class="del">删除</a></p>
    </li> -->
   
  </ul>
  <div class="jian">共<em></em>件商品</div>
</div>
</if>

    </li>
    </ul>
  </div>
</div>
<!-- 搜索区域结束 -->

<!-- 菜单栏开始 -->

<div id="nav">
<div class="nav_in">
<div class="nav">
  <a class="all" id="all" href="#">所有商品分类</a>
  <!-- 导航开始 -->

<!-- style="display:none" -->
  <div class="menu" >
    <ul>
      <foreach from='$data' key='$k' value='$v'>
      <li>
       
       <div class="ico ico{$k}">{$v['ico']}</div>
               
           <a href="{|U:'Index/List/index',array('cid'=>$v['cid'])}">{$v['cname']}</a>
              <div class="submenu">
                 <div class="l">
               <foreach from='$v[_data]' key='$key' value='$value'>
                   <dl>
                    <dt><a href="{|U:'Index/List/index',array('cid'=>$value['cid'])}">{$value['cname']}</a></dt>
                     <foreach from='$value[_data]' key='$key3' value='$value3'>
                    <dd>
                  <a href="{|U:'Index/List/index',array('cid'=>$value3['cid'])}"> {$value3['cname']}</a></dd>
                     </foreach>   
                  </dl>
                   </foreach>    
              
                 
                 </div>

               <div class="r">
        <a href="#"><img src="__PUBLIC__/images/menu1.jpg"  alt="" /></a>
        <a href="#"><img src="__PUBLIC__/images/menu2.jpg" width="239" height="198" alt="" /></a>
        <a href="#"><img src="__PUBLIC__/images/menu3.jpg" width="239" height="198"  alt="" /></a>
               </div>
              </div>
              
      </li>
    </foreach>  
    </ul>
  </div>

  <!-- 导航结束 -->  
</div> 
<!-- 导航左边开始 -->
  <ul class="nav_r">

  <li><a class="cur" href="__ROOT__">首页</a></li>
  <foreach from='$menu' key='$k' value='$v'>
  <li><a href="{|U:'Index/List/index',array('cid'=>$v['cid'])}">{$v.ctitle}</a></li>
 </foreach>
  <span class="tel"><a class="img" href=""><img src="__PUBLIC__/images/tel.jpg" alt="" /></a></span>
</ul>

  <!-- 导航右边结束 -->
</div>
</div>
<!-- 菜单栏结束